1 <?php
2     include(
"../includes/config.php");
3     session_start();
4     
if(isset($_SESSION['retailer_login'])) {
5             $query_selectProducts =
"SELECT * FROM products,categories,unit WHERE products.pro_cat=categories.cat_id AND products.unit=unit.id ORDER BY pro_id";
6             $result_selectProducts = mysqli_query($con,$query_selectProducts);
7         }
8         
else {
9             header(
'Location:../index.php');
10         }
11 ?>
12 <!DOCTYPE html>
13 <html>
14 <head>
15     <title> View Products </title>
16     <link rel=
"stylesheet" href="../includes/main_style.css" >
17 </head>
18 <body>
19     <?php
20         include(
"../includes/header.inc.php");
21         include(
"../includes/nav_retailer.inc.php");
22         include(
"../includes/aside_retailer.inc.php");
23     ?>
24     <section>
25         <h1>View Products</h1>
26         <form action=
"" method="POST" class="form">
27         <table
class="table_displayData">
28             <tr>
29                 <th> ID </th>
30                 <th> Name </th>
31                 <th> Price </th>
32                 <th> Unit </th>
33                 <th> Category </th>
34             </tr>
35             <?php $i=
1; while($row_selectProducts = mysqli_fetch_array($result_selectProducts)) { ?>
36             <tr>
37                 <td> <?php echo $row_selectProducts[
'pro_id']; ?> </td>
38                 <td> <?php echo $row_selectProducts[
'pro_name']; ?> </td>
39                 <td> <?php echo $row_selectProducts[
'pro_price']; ?> </td>
40                 <td> <?php echo $row_selectProducts[
'unit_name']; ?> </td>
41                 <td> <?php echo $row_selectProducts[
'cat_name']; ?> </td>
42             </tr>
43             <?php $i++; } ?>
44         </table>
45         </form>
46     </section>
47     <?php
48         include(
"../includes/footer.inc.php");
49     ?>
50 </body>
51 </html>


Gõ tìm kiếm nhanh...